import { Component } from '@angular/core';
import {App, IonicPage, NavController, NavParams} from 'ionic-angular';
import {CleanDetailPage} from "../clean-detail/clean-detail";
import {ROUTER} from "../../service/router.service";
import {GOODS} from "../../api/goods-api";
import {LocalStorage} from "../../utils/localstorage.utils";
import {GoodModel} from "../../model/good.model";

/**
 * Generated class for the LifeCleanningPage page.
 *
 * See http://ionicframework.com/docs/components/#navigation for more info
 * on Ionic pages and navigation.
 */
@IonicPage()
@Component({
  selector: 'page-life-cleanning-page',
  templateUrl: 'life-cleanning-page.html',
})
export class LifeCleanningPage {
  commoditys=[]

  constructor(public ls:LocalStorage,public navCtrl: NavController,public app: App, public navParams: NavParams,private ROUTER: ROUTER,private GOODS:GOODS) {
  }

  ionViewDidLoad() {
    document.title='品质保洁';
    console.log('ionViewDidLoad LifeCleanningPage');
    this.GOODS.getList({type:3,size:999},(v)=>{
      this.commoditys = v.content
    })
  }

  CleanDetail(v) {
    this.ls.setObject('good', new GoodModel(v));

    this.ROUTER.go(ROUTER.CLEANDETAIL);
  }

}
